<!-- 下拉 -->
<template lang="html">
  <el-radio-group
    v-model="defaultValue[field.prop]"
    v-bind="groupAttrs"
    @change="change"
  >
    <el-radio
      v-for="(item,index) in field.options"
      :key="index"
      v-bind="computeSelfAttrs(item.attrs)"
      :label="item[alias.label]"
    >
    </el-radio>
  </el-radio-group>
</template>

<script>
let radioOpt = require('../common/index').default('radio')
export default Object.assign(radioOpt, {
  mixins: [{
    data () {
      const {
        groupAttrs = {},
        radioAttrs = {},
        alias = {
          label: 'label'
        }
      } = this.field

      return {
        groupAttrs,
        radioAttrs,
        alias
      }
    },
    methods: {
      computeSelfAttrs (value) { // 合并属性
        return Object.assign({

        }, this.radioAttrs, value)
      }
    }
  }]
})
</script>
